/**
 * 角色表
 */
import { BaseEntity } from 'egg-cool-entity';
import { Entity, Column, ManyToOne, JoinColumn } from 'typeorm';
import Plan from './plan';

@Entity({ name: 'product' })
export default class Product extends BaseEntity {
    /**
     * 关联计划
     */
    @ManyToOne(_type => Plan, p => p.products, { nullable: false })
    @JoinColumn({
        name: 'plan_id',
    })
    plan!: Plan;

    @Column({
        comment: '图号',
        nullable: true,
    })
    figurenumber: string;

    @Column({
        comment: '零件名称',
        nullable: true,
    })
    component: string;

    @Column({
        type: 'int',
        comment: '数量',
        nullable: true,
    })
    quantity: number;

    @Column({
        type: 'int',
        comment: '挂',
        nullable: true,
    })
    suspend: number;

    @Column({
        comment: '漆膜厚度',
        nullable: true,
    })
    film: string;

    @Column({
        comment: '颜色',
        nullable: true,
    })
    color: string;

    @Column({
        comment: '白班完成情况',
        nullable: true,
    })
    dayshift: string;

    @Column({
        comment: '夜班完成情况',
        nullable: true,
    })
    nightshift: string;

    @Column({
        comment: '备注',
        nullable: true,
    })
    remark: string;
}
